﻿using System;
using System.Collections.Generic;
using Iot.AlarmDispose.Database.Entities;

namespace Iot.AlarmDispose;

/// <summary>
///     告警总接口
/// </summary>
public interface IAlertBus<TAlertClassify, out TAlertsHistory>
    where TAlertClassify : class, IAlertClassify
    where TAlertsHistory : class, IAlertsHistory<TAlertClassify>
{
    /// <summary>
    ///     实时告警显示接口
    /// </summary>
    IReadRealTimeAlertList<TAlertClassify, TAlertsHistory> ReadRealTimeAlertList { get; }

    /// <summary>
    ///     告警实时数据发生变化时更新
    /// </summary>
    event Action<int>? AlertUpDateEvent;

    /// <summary>
    ///     告警数据每一次处理都会下发实时报警数量
    /// </summary>
    event Action<int>? AlertEveryTimeUpDateEvent;


    /// <summary>
    ///     设置需要处理的告警对象
    /// </summary>
    /// <param name="data"></param>
    void SetAlertClassify(IEnumerable<TAlertClassify> data);
}